home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Now 11 / CD-ROM Now MegaDisc 11 (1995-02).iso / utils / jreader / jreadr24.doc < prev    next >
Text File  |  1994-06-06  |  21KB  |  438 lines

  1.  
  2.                            J R E A D E R
  3.  
  4.       Japanese Text Reader with Online Dictionary Search & Yomikata Lookup
  5.       ====================================================================
  6.  
  7.                             Version 2.4 
  8.  
  9.  
  10.                             J.W. Breen
  11.                            January 1994
  12.                                     
  13.  
  14.                              CONTENTS
  15.  
  16.                         1. INTRODUCTION
  17.  
  18.                         2. THIS DOCUMENT
  19.  
  20.                         3. INSTALLATION
  21.  
  22.                         4. ENVIRONMENT
  23.  
  24.                         5. OPERATION
  25.  
  26.                         6. DICTIONARY SEARCHING 
  27.  
  28.                         7. VERB & ADJECTIVE MODIFICATION
  29.  
  30.                         8. YOMIKATA SEARCHING
  31.  
  32.                         9. KANJI INFORMATION
  33.  
  34.                        10. JREADER ON A PALMTOP
  35.  
  36.                        11. ADDITIONS TO PREVIOUS VERSION(S)
  37.  
  38.                        12. AUTHOR'S COMMENT
  39.  
  40.  
  41.  
  42. 1. INTRODUCTION 
  43.  
  44. This program provides a PC operating under MS-DOS with the capability to read 
  45. and  display a text file containing Japanese characters (kana & kanji),  with 
  46. the option of looking up the displayed words in a Japanese/English dictionary 
  47. file or in a kanji-to-kana yomikata file.  
  48.  
  49. The Japanese characters in the text files can either be in the EUC,  New-JIS, 
  50. Old-JIS  or Shift-JIS codes.  Hankaku codes are supported for Shift-JIS,  but 
  51. not for EUC.  Codes which are not supported,  such as NEC-JIS or EUC-hankaku, 
  52. can be converted into one of the supported codes  using  a  utility  such  as 
  53. JCONV. 
  54.                  
  55. Although JREADER is  intended  to  help  non-Japanese  people  read  Japanese 
  56. language  text  files,  it can also be used by Japanese to read English text.  
  57. Its usefulness in this role is limited  by  the  dictionary,  which  is  more 
  58. oriented  to  the Japanese to English mode,  and the fact that the dictionary 
  59. search cannot cope with things like English's "strong" verbs (swim/swam/swum, 
  60. be/am/are, go/went, etc.). 
  61.  
  62. JREADER is an extension of the  author's  JDIC  (Japanese/English  Dictionary 
  63. Display)  program,  which  has  been  designed  specifically  to operate on a 
  64. dictionary in the "EDICT" format originally used  by  the  MOKE  (Mark's  Own 
  65. Kanji  Editor)  Japanese  text  editor.  As  with  JDIC,  JREADER's operating 
  66. environment has been designed to be similar to MOKE's,  and it  can  use  the 
  67. same  environment  variables  and control file as MOKE.  
  68.  
  69. The  executable  code  and documentation of JREADER is hereby released to the 
  70. "public domain".  All usage of this program is at the user's risk,  and there 
  71. is no warranty on its performance. 
  72.  
  73. All  the  Japanese  displayed is in kana and kanji,  so if you cannot read at 
  74. least hiragana and katakana,  this program will not be much use for you.  The 
  75. author has NO intention of producing a version using romanized Japanese. 
  76.  
  77.  
  78. 2. THIS DOCUMENT
  79.  
  80. JREADER  is  an  extension of JDIC,  and shares a similar operating method as 
  81. JDIC.  Consequently this document file only includes details of where JREADER 
  82. differs  from  JDIC.  Please  make  sure  you  have  and read the appropriate 
  83. JDICnn.doc file. 
  84.  
  85.  
  86. 3. INSTALLATION
  87.  
  88. This program is distributed in a "zoo" archive (jdic24.zoo).  Both  JDIC  and 
  89. JREADER share a common operating environment.  Please follow the installation 
  90. details in JDIC24.DOC, which is in the "JDIC24.ZOO" file. 
  91.  
  92. In addition, to get the full function from JREADER, you should have the files 
  93. WSKTOK.DAT  and  WSKTOK.IND.  These  are the kanji_to_kana file from MOKE and 
  94. its index file.  Without them the "y" (yomikata  lookup)  function  will  not 
  95. operate. If you are a MOKE user (Version 2.0 or later) you will have them. 
  96.  
  97. The author has produced an expanded form of the WSKTOK.DAT file by adding  in 
  98. the  additional entries in EDICT,  plus further entries from the full WNN and 
  99. SKK dictionaries.  This is available in the WSKWNN.ZOO  file,  along  with  a 
  100. matching WSKTOK.IND index file. 
  101.  
  102. (For the curious,  there is an explanation of these files in an  Appendix  to 
  103. JDIC24.DOC.) 
  104.  
  105.  
  106. 4. ENVIRONMENT
  107.  
  108. JREADER  uses  the  same  environment variables and JDIC.RC/MOKE.RC fields as 
  109. JDIC (and MOKE).  These affect things like paths and colours.  See JDIC24.DOC 
  110. for details. 
  111.  
  112. JREADER has one special (optional) entry in  the  JDIC.RC/MOKE.RC  file.  The 
  113. verb/adjective  deinflection  function  (see  below)  can  be disabled by the 
  114. following line in JDIC.RC/MOKE.RC: 
  115.  
  116. jverb   off
  117.  
  118. The default is for this option to be enabled.
  119.  
  120.  
  121. 5. OPERATION
  122.  
  123. (a) LOADING
  124.  
  125. JREADER is simple to operate. The command-line invocation is: 
  126.  
  127.          jreader <options> text-file(s)
  128.  
  129. The same -l,  -f,  -v,  -cDIR and -bnn  options  are  used  as  in  JDIC.  In 
  130. addition, JREADER uses: 
  131.  
  132.  -sn (3 < n < 8) specifies that the text window is to use n/10 of the screen, 
  133.                    The default is n = 7. 
  134.  
  135.  -ddictionary-file  specifies  the file that is to be used as the dictionary, 
  136.                    along with an index file  with  an  extension  of  ".jdx".  
  137.                    This latter file must be created using the JDXGEN utility.  
  138.                    The default is "edict" with "edict.jdx" as the index file, 
  139.                    or "jtoe.dct" and "jtoe.jdx", whichever is present. 
  140.                                        
  141.  -Llogfile  specifies the name of a file to log possible new "edict" entries. 
  142.                    The default name is "jreader.log". 
  143.  
  144.  -/search_string specifies a string for which a search is  invoked  when  the 
  145.                    file  is  read.  See  the  section  below on searching for 
  146.                    strings.  The same options are available as  in  a  string 
  147.                    entered from the keyboard, and as well a serach string can 
  148.                    be in (EUC coded) kanji or kana. 
  149.                    
  150. One or more file names can be provided. MS-DOS wildcards can be used also. 
  151.            
  152. (b) READING FILES
  153.  
  154. The working screen of JREADER contains two windows.  The upper  displays  the 
  155. text being read,  the lower displays control information,  and the dictionary 
  156. and yomikata search results. 
  157.  
  158. The lower window also displays a short "help" display when the window is  not 
  159. being  used for a regular display.  The help display can be turned off by the 
  160. "-v" command-line option and the "verbose off" line in the JDIC.RC  file.  It 
  161. can also be toggled on and off by the "o" command. 
  162.  
  163. The first screenful of the text file is displayed when  the  program  starts. 
  164. From then on most operation is by single keystroke commands. They are: 
  165.  
  166. <PgDn> reads the next screen of the file.  The  last  line  of  the  previous 
  167. screen is repeated as the first line of the next. 
  168.  
  169. <PgUp> reads the previous screen  of  the  file.  The  backspacing  technique 
  170. involves backspacing the number of lines on the current screen,  so it should 
  171. usually result in the previous screen being displayed,  unless  there  are  a 
  172. number of "folded" lines. 
  173.  
  174. <Ctrl-PgUp> restarts the file from the beginning. 
  175.           
  176. <Ctrl-PgDn> skips to the end of the file, and displays the last 10 lines. 
  177.  
  178. <Arrow>  The  four  arrow  keys  can  be  used to position the cursor under a 
  179. character which may be used as the start of a key for a dictionary search.  A 
  180. down-arrow while on the last line causes the display to scroll down one line, 
  181. and an up-arrow on the first line causes an upwards scroll. 
  182.  
  183. <Enter> positions the cursor at the start of the next line. 
  184.  
  185. <End> positions the cursor at the end of the current line. 
  186.  
  187. <Home> positions the cursor at the start of the current line. 
  188.  
  189. <Ctrl-Home> positions the cursor at the start of the screen. 
  190.  
  191. <Ctrl-End> positions the cursor at the last line of the screen. 
  192.  
  193. <Space> triggers a dictionary search using the string of characters beginning 
  194. with the one marked by the cursor. (See below.) 
  195.                                  
  196. <a> the same dictionary search as <space>,  but if the search key begins with 
  197. one or more kanji characters, the search will match against any occurrence of 
  198. the  character(s)  among  kanji compounds in the dictionary,  instead of just 
  199. those at the start of compounds. 
  200.  
  201. </> invokes a prompt for  a  string  of  characters,  the  file  is  searched 
  202. forwards, starting at the *second* line on the display, until a line is found 
  203. containing that string.  This scan is case sensitive. 
  204.  
  205. There are two special options with this search:
  206.  
  207.     (i) if the entered string begins with a "\",  the remainder is treated as 
  208.     a hexadecimal coding of one or more kanji or kana. If the first character 
  209.     of the code is a "k",  the coding is treated as Kuten-encoded,  and if it 
  210.     is an "s",  it  is  treated  as  Shift-JIS.  For  example,  \k3214  is  a 
  211.     Kuten-encoded kanji and \s82a4 is Shift-JIS encoded kana,  while \3b7a is 
  212.     a JIS encoded kanji. 
  213.     
  214.     (Note that it is possible to obtain an incorrect match on occasions  when 
  215.     using  this option,  particularly when searching for a single kanji.  The 
  216.     scan uses a simple "strstr" function,  which  is  not  sensitive  to  the 
  217.     boundaries of individual kanji or kana,  and thus may find a match on the 
  218.     the combination of the second byte of one character, and the first of the 
  219.     next.) 
  220.  
  221.     (ii) if the first character is a "?", the *previous* search is repeated.
  222.     
  223. Note that an initial search string can be entered as a  command-line  option. 
  224. In all cases the search can be abandoned by pressing the Esc key. 
  225.  
  226. <c> triggers a search similar to the "/" command,  except the  key  is  taken 
  227. from  the  screen,  starting  at  the cursor position.  You are asked for the 
  228. length of the key,  which may be up to 9  characters  long  (kana,  kanji  or 
  229. ASCII). You may repeat the search using the "/" command with the "?" option.
  230.  
  231. <l> logs the character string marked by the cursor  to  a  file  (default  is 
  232. "jreader.log").  The  logged  data is in "edict" format,  i.e.  `kanji [kana] 
  233. /english .../',  with the logged characters being  inserted  in  the  `kanji' 
  234. field.  You  will be prompted for the string length (up to 9 characters).  If 
  235. you respond with Enter,  and the cursor is on a Kanji,  all the kanji in  the 
  236. compound  will  be  logged.  You are also given the option of adding up to 50 
  237. characters of English to the logged entry.  (The main purpose of the  logging 
  238. function is to generate a file of Japanese words which are not  currently  in 
  239. the dictionary file.  This file can be edited later, the yomikata and English 
  240. translation  added  or  modified,  and  the  entries  included  in  the  full 
  241. dictionary.) 
  242.  
  243. <y> invokes a scan of the "WSKTOK.DAT" file to find the yomikata of the kanji 
  244. compound starting with the character at the cursor.  [This option only  works 
  245. if  the  "WSKTOK.DAT"  and  "WSKTOK.IND" files are available,  i.e.  you need 
  246. either to be a MOKE (2.0 or later) user,  or you need to  have  obtained  the 
  247. files  separately  from  the  "WSKWNN.ZOO"  archive.]  The  longest  matching 
  248. sequence is displayed,  and you are given the option of  logging  this  entry 
  249. (kanji and kana) to the "JREADER.LOG" file, along with up to 50 characters of 
  250. English.  In  combination  with the <l> option above,  this option provides a 
  251. useful way of building up the dictionary file. 
  252.                  
  253. <n>  looks up and displays various details about the character at the cursor. 
  254. If the character is kana or ASCII,  the JIS or hexadecimal code is displayed. 
  255. For  kanji,  the  information  displayed  is the JIS code in hex,  the Nelson 
  256. number, the Halpern number, the Radical number (Bushu), the stroke count, the 
  257. on and kun readings, the English meaning(s) and a number of other information 
  258. fields.  This function requires the "KINFO.DAT"  file  to  be  present.  (See 
  259. JDIC24.DOC and KANJIDIC.DOC for further information.) 
  260.  
  261. <s>  skips  ahead  in  the  text  file  to a line starting with "Article:" or 
  262. "Subject:".  This is to simplify reading a file containing  several  Japanese 
  263. news items. 
  264.  
  265. <k>  skips  the cursor to the start of the next Kanji compound.  If Automatic 
  266. Lookup mode is active,  the dictionary is searched for  this  compound.  (See 
  267. below)                                         
  268.  
  269. <w> skips the cursor to the start of the next of the next English word.  i.e. 
  270. the first slphabetic character after a non-alphabetic. 
  271.     
  272. <f>  initiates the opening of either the next file on the command line,  or a 
  273. totally new file. You are prompted for more details. 
  274.  
  275. <m> displays the next window of dictionary matches (if any). 
  276.  
  277. <d>  displays  a status report of the files in use,  the position in the file 
  278. being read,  the buffer usage,  and the state of user configurable  switches. 
  279. Note  that  the  line position is not always accurate if there have been some 
  280. PgUps,  and particularly if the Ctrl-PgDn skip_to_EOF option has  been  used, 
  281. which case the line count is set to 9999. 
  282.  
  283. <j> jump ahead a number of lines. There is a prompt asking for the number. 
  284.  
  285. <v> toggles the verb deinflection function between enabled and disabled. 
  286.  
  287. <b> toggles the automatic blanking of the lower window.  Normally the display 
  288. on the lower window is left there until the next search, log, etc. is carried 
  289. out.  Some users prefer not to have such displays present.  The  <b>  command 
  290. toggles on and off a function which  will  blank  the  lower  window  on  any 
  291. keystroke following a search. 
  292.  
  293. <o>  toggles  the  production of the help display in the lower window.  (When 
  294. this option is in use,  it over-rides the operation of the automatic blanking 
  295. of the lower window.) 
  296.  
  297. <F1> Displays a summary of the keyboard commands. 
  298.  
  299. <F2> Toggles Automatic Lookup mode (See <k> above.) 
  300.  
  301.  
  302. 6. DICTIONARY SEARCHING 
  303.  
  304. The dictionary search is similar to the one used in JDIC, except that the key 
  305. is  taken  from  the  text being displayed,  rather than from keyboard input.  
  306. Thus the search can be on keys consisting of kanji compounds, as well as kana 
  307. and ascii. 
  308.  
  309. Starting with the character marked by the cursor,  the longest match is found 
  310. and  displayed,  followed by the next longest,  and so on.  Usually the first 
  311. match is the one you want.  The dictionary display is identical  to  that  in 
  312. JDIC,  except that each line is preceded by the number of matched characters.  
  313. If there are more matched lines than fit in the window, pressing "m" displays 
  314. the next window-full. 
  315.  
  316.  
  317. 7. VERB & ADJECTIVE MODIFICATION
  318.  
  319. When  a  dictionary  search  is initiated for text which consists of a single 
  320. kanji followed by two or more kana,  JREADER checks to see if it one  of  the 
  321. common verb or adjective conjugations or inflections, and if so, examines the 
  322. dictionary  using  the derived "plain" or "dictionary form" of the word.  The 
  323. user may then proceed with a normal search.  The inflection details used  are 
  324. in  the  file  "VCONJ",  which  may  be modified by the user.  Note that this 
  325. feature can be disabled by setting "jverb off" in the  JDIC.RC/MOKE.RC  file, 
  326. or  by  omitting the VCONJ file.  It can also be turned on or off dynamically 
  327. with the "v" command. 
  328.  
  329. This function is not highly sophisticated,  and will not always  produce  the 
  330. right  result,  particularly when handling the more obscure grammatical forms 
  331. which use the "-masu stem" of verbs.  It is correct, however, over 95% of the 
  332. time,  and eliminates the problem of having the dictionary entry matching the 
  333. selected text only appearing about 20 or 30 lines down the display. 
  334.  
  335.  
  336. 8. YOMIKATA SEARCHING
  337.  
  338. The  "WSKTOK.DAT"  file  contains  thousands  of  kanji  compounds with their 
  339. readings in kana.  It is sorted,  and indexed on the first byte of the  first 
  340. character  in  the "WSKTOK.IND" file.  JREADER seeks into and scans this file 
  341. for the longest matching sequence of characters.  Only one such  compound  is 
  342. displayed.  The  present author has expanded the original MOKE file,  and the 
  343. expanded version is available in the WSKWNN.ZOO archive. 
  344.  
  345.  
  346. 9. KANJI INFORMATION
  347.  
  348. The  kanji  information  displayed  by  the  <n>  command  is  in  the   file 
  349. "KINFO.DAT".  KINFO.DAT  is  built  from  the  PD  "KANJIDIC"  file.  See the 
  350. KANJIDIC.DOC file for the full details on this information,  and the Appendix 
  351. to JDIC24.DOC for the structure of KINFO.DAT. 
  352.   
  353.  
  354. 10. JREADER ON A PALMTOP
  355.   
  356. JREADER  can  be  used successfully on the tiny HP100LX Palmtop (and probably 
  357. other emerging PCs of this type.) See JDIC24.DOC for more  details  of  this. 
  358. The author operates JREADER on a Palmtop by: 
  359.  
  360. (a) installing it in the Application Manager as a call to a batch file,  i.e. 
  361. the "Path" box contains: "a:\kanji\jrbat.bat|350". 
  362.  
  363. (b) creating a batch file (JRBAT.BAT) containing the following lines: 
  364.  
  365.         @echo off
  366.         input File Name(s) for JREADER? :
  367.         jreader -f -s6 %ANS%
  368.         
  369. The  "input.com"  utility,  which  is  in  the JDICPALM.ZOO archive,  is a PD 
  370. program which enables a text string (e.g.  a  file  name)  to  be  passed  to 
  371. JREADER via the "ANS" environment variable. 
  372.  
  373. 11. ADDITIONS TO PREVIOUS VERSION(S)
  374.  
  375. V1.1 - Yomikata lookup, TAB expansion,  Shift-JIS reading,  PgUp for previous 
  376. screen. 
  377.  
  378. V2.0  -  Larger  Help Screen,  double-Escape to exit,  "n" command to look up 
  379. Nelson,  etc.  information,  alternative font  files  and  dictionary  names, 
  380. multiple  input  files,  file  restart,  single-line scrolling,  text search, 
  381. paging of font and index files, capability of handling a dictionary up to 1.5 
  382. Mbytes. 
  383.  
  384. V2.1 - Adds the ability to match a kanji with any occurrence  of  it  in  the 
  385. dictionary (the <a> function). 
  386.  
  387. V2.2  -  Removes  the 1.5Mbyte restriction on dictionary size.  Tidies up the 
  388. kanji display (<n> option). 
  389.  
  390. V2.3 - Added  the  verb/adjective  deinflector  facility,  the  <j>  and  <d> 
  391. options,  the  Kuten  field in the kanji display.  Enabled the display of the 
  392. last 4 JIS2 kanji when using the K16JIS2.FNT file.  Added the  JDIC.RC  file.  
  393. The   -cDIR  command-line  option.   Improved  the  search  speed,   and  the 
  394. line-folding in the dictionary and kanji display. 
  395.  
  396. V2.4  -  compressed  the display,  including introducing user-selectable font 
  397. spacing,  and rearranging the lower window to enable better operation on  CGA 
  398. displays  (e.g.  the HP Palmtop.) Added the <b> blanking of the lower screen, 
  399. and the "Searching ..." message.  Added the handling of  half-width  kana  in 
  400. SJIS  files.  For  text searching,  added the <c> option,  the "\" setting of 
  401. JIS, SJIS and Kuten,  the command-line option,  and the "?" repeat.  Expanded 
  402. the "d" display, and fixed the erroneous line counts.  Added the help display 
  403. in the lower window. 
  404.  
  405.  
  406. 12. AUTHOR'S COMMENT
  407.  
  408. JREADER is to me a natural extension of JDIC,  and further exploits the  fast 
  409. dictionary  scanning technique used therein.  It also has been written with a 
  410. need in mind.  I had been using Mark Edwards' excellent VIEW and MOKE to read 
  411. fj.* news (using the SNUZ news reader into "mtfuji".) I was frustrated by the 
  412. slowness of the English lookup in MOKE (a sequential read of the entire file) 
  413. and its refusal to add a compound to the dictionary if  it  was  not  in  the 
  414. kanji/kana  henkan file.  Also both MOKE and VIEW require precise delineation 
  415. of the search string using several keystrokes.  This can  result  in  several 
  416. slow  attempts  to  find  meanings  for portions of a kanji compound.  What I 
  417. wanted was something friendlier and faster in a reading environment, with the 
  418. capability of providing updates to my EDICT dictionary. 
  419.  
  420. From this grew JREADER,  and it has turned out to be a very powerful Japanese 
  421. text  reader,  with  many  devoted  users  around the world.  (JREADER's code 
  422. actually formed the basis of the code for XJDIC,  the Unix X11 port of  JDIC, 
  423. because  XJDIC  provides virtually all of JREADER's functionality through the 
  424. kterm cut_and_paste facility.) 
  425.  
  426. As  with  the JDIC program,  I am grateful to the many beta-testers,  and the 
  427. people who have suggested operational improvements, many of which I have been 
  428. able to incorporate. 
  429.  
  430. As ever, comments and suggestions are welcome. 
  431.  
  432. Jim Breen (jwb@capek.rdt.monash.edu.au) 
  433. Department of Robotics & Digital Technology 
  434. Monash University 
  435. Melbourne, Australia                                    
  436. Nov 1991 - January 1994               
  437.  
  438.